from django.apps import AppConfig
from lib.job import Job

_cached_object = None

class BaseConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'base'

    def ready(self):
        # The initialization is performed here: instantiate the job class. The ready function is executed once when the django service starts
        global _cached_object
        if _cached_object is None:
            _cached_object = Job()
        return _cached_object